<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use Illuminate\Support\Facades\Route;

Route::get('/test', function () {
    return view('welcome');
});

Route::post('/', 'WxRouteController@rewrite'); //请求转发

Route::prefix('diff_msg')->group(function () {
    //任务抓取与推送
    Route::prefix('toutiao')->group(function () {
        Route::get('yeshifu', 'DailyPushController@toutiaoDiffMessage');
        Route::get('xintiaohuiyi', 'DailyPushController@toutiaoDiffMessageDaily');
    });
});

//清风抓取推送
Route::get('wool_qing_feng', 'DailyPushController@dailyWoolNotice');

Route::prefix('tools')->group(function () {
    Route::any('get_client_info', 'ToolsController@getClientInfo');
    Route::any('gitee_webhook', 'ToolsController@giteeWebhook');
});

//供H5使用
Route::prefix('wechat')->group(function () {
    Route::post('work_send_msg', 'WxWorkMsgController@sendMsg'); //发送微信信息
    Route::get('token_check', 'WxShareController@wxTokenCheck'); //token校验
    Route::post('js_config', 'WxShareController@jsConfig'); //获取JsConfig
    Route::post('js_config_self', 'WxShareController@jsConfigSelf'); //获取JsConfig
    Route::get('oauth', 'WxOauthController@oauth'); //访问链接
    Route::get('oauth_callback', 'WxOauthController@oauthCallback'); //回调
});
//H5
Route::prefix('h5')->group(function () {
    Route::any('save_answer', 'H5Controller@saveAnswer');
    Route::any('get_user_permission', 'H5Controller@getUserPermission');
    Route::any('reset_permission', 'H5Controller@resetPermission');
    Route::any('do_cookie', 'H5Controller@doCookie');
    Route::any('game/un_buy_list', 'H5Controller@getIsBuyNullList');
    Route::any('game/save_buy', 'H5Controller@saveIsBuy');
});
